package com.yupi.oj.codeBox.service.impl;

import com.yupi.oj.codeBox.category.CodeBox;
import com.yupi.oj.codeBox.category.impl.SampleCodeBox;
import com.yupi.oj.codeBox.model.requesst.ExecuteRequest;
import com.yupi.oj.codeBox.model.response.ExecuteResponse;
import com.yupi.oj.codeBox.service.ExecuteCodeService;
import org.springframework.stereotype.Service;

/**
 * @author yanghaifeng
 * @date 2024/4/23 10:53
 */
@Service
public class ExecuteCodeServiceImpl implements ExecuteCodeService {

    @Override
    public ExecuteResponse execute(ExecuteRequest executeRequest) {
        System.out.println("执行方法");
        // 调用对应的代码沙箱执行
        CodeBox codeBox = new SampleCodeBox();
        return codeBox.interior(executeRequest);
    }
}
